package myProject.gwt.client;

import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class DebugPanel extends VerticalPanel {

	private static DebugPanel instance = new DebugPanel();
	private static boolean enableDebug;
	
	public static DebugPanel getInstance(){
		return instance;
	}
	
	public static void addText(String text){
		if(!enableDebug)return;
		if(instance.getWidgetCount() > 20)instance.clear();
		instance.add(new Label(text));
		
	}

	public static boolean getEnableDebug() {
		return enableDebug;
	}

	public static void setEnableDebug(boolean b) {
		enableDebug = b;
	}
	
}
